﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Prospectus
{
    public class Inventory
    {
        readonly List<Block> items;

        public List<Block> Items
        {
            get { return items; }
        }

        public int Capacity
        {
            get { return items.Capacity; }
        }

        public Inventory()
        {            
            items = new List<Block>();
            items.Capacity = 0;
        }

        public void AddItem(Block block)
        {
            items.Add(block);
            items.TrimExcess();

            if (Capacity > items.Count)
                items.Capacity = items.Count;
        }

        public void RemoveItem(Block block)
        {
            items.Remove(block);
            items.TrimExcess();
            items.Capacity--;
        }
    }
}
